package com.yipingnai.blog.config;

import com.yipingnai.blog.filter.URLFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: jiangym
 * @Date: 2020/5/18 16:15
 */
@Configuration
public class WebConfig {
    @Bean
    public FilterRegistrationBean urlFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean(new URLFilter());
        registration.addUrlPatterns("/admin/*");
        registration.setName("URLFilter");
        return registration;
    }
}
